package model

import "github.com/zeromicro/go-zero/core/stores/sqlx"

var _ MenuPermissionsModel = (*customMenuPermissionsModel)(nil)

type (
	// MenuPermissionsModel is an interface to be customized, add more methods here,
	// and implement the added methods in customMenuPermissionsModel.
	MenuPermissionsModel interface {
		menuPermissionsModel
		withSession(session sqlx.Session) MenuPermissionsModel
	}

	customMenuPermissionsModel struct {
		*defaultMenuPermissionsModel
	}
)

// NewMenuPermissionsModel returns a model for the database table.
func NewMenuPermissionsModel(conn sqlx.SqlConn) MenuPermissionsModel {
	return &customMenuPermissionsModel{
		defaultMenuPermissionsModel: newMenuPermissionsModel(conn),
	}
}

func (m *customMenuPermissionsModel) withSession(session sqlx.Session) MenuPermissionsModel {
	return NewMenuPermissionsModel(sqlx.NewSqlConnFromSession(session))
}
